{include file="public/header"}
<title>添加</title>
</head>
<body>


<article class="page-container">
    <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 8px;" id="list">

        <thead>
        <tr class="text-c">
            <!--<th width="80">序号</th>-->
            <th width="80">一级</th>
            <th width="80">二级</th>
            <th width="80">三级</th>
            <th width="80">分类</th>
            <th width="80">名称</th>
            <th width="50">方量</th>
            <th width="50">价格</th>
            <th width="100">规则</th>
            <th width="40">质保</th>
            <th width="150">基建时间</th>
            <th width="80">图片</th>
            <!--<th width="80">优惠金额</th>-->
            <th width="80">赠送项目</th>
            <th width="80">备注</th>
            <th width="70">总金额</th>
            <th width="70">方案</th>
            <th width="70">确认</th>
            <th width="100">操作</th>

        </tr>
        </thead>
        <tbody>
        {volist name='capital' id='vo' key='i'}
        <tr class="text-c">
            <!--<td class="col-1">{$vo.capital_id}</td>-->
            <td >{$vo.wen_a}</td>
            <td >{$vo.wen_b}</td>
            <td >{$vo.wen_c}</td>
            <td >{$vo.class_a}</td>
            <td >{$vo.class_b}</td>
            <td >{$vo.square}/{$vo.company}</td>
            <td >{$vo.un_Price}</td>
            <td >{$vo.rule}</td>

            <!--<td >{$vo.rule}</td>-->
            <td ><?php if($vo['zhi'] ==1){ ?>是<?php }else{ ?>否<?php }?></td>
            <td >{:date('Y-m-d H:i:s',$vo.crtime)}</td>
            <td > <?php if(is_array($vo['capitalgo'])) foreach($vo['capitalgo'] as $user){ ?>
                <img style="width:10%;" src="<?php echo $user ?>">
                <?php } ?></td>


            <!--<td >{$vo.give_money}</td>-->
            <td >{$vo.give_d}</td>
            <td >{$vo.give_remarks}</td>
            <td >{$vo.to_price} </td>
            <td >{$vo.programme} </td>
            <td >{$vo.enable} </td>
            <td>
                <a style="text-decoration:none" class="ml-5 edit1"  data-id="{$vo.capital_id}" key="{$i}"  count="<?php echo count($capital) ?>"  href="javascript:;" title="编辑"><span class="label label-primary">编辑</span></a><a style="text-decoration:none" class="ml-5 del1"  data-id="{$vo.capital_id}" key="{$i}"  count="<?php echo count($capital) ?>"  href="javascript:;" title="删除"><span class="label label-default">删除</span></a>
            </td>
        </tr>

        {/volist}
        </tbody>
    </table>
    <div class="pages" style="float: right">{$capital->render()}</div>
    <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 8px;" id="lists">

        <thead>
        <tr class="text-c">
            <!--<th width="80">序号</th>-->
            <th width="80">一级</th>
            <th width="80">二级</th>
            <th width="80">三级</th>
            <th width="80">分类</th>
            <th width="80">名称</th>
            <th width="50">方量</th>
            <th width="50">价格</th>
            <th width="100">规则</th>
            <th width="40">质保</th>
            <th width="150">基建时间</th>
            <th width="80">图片</th>
            <!--<th width="80">优惠金额</th>-->
            <th width="80">赠送项目</th>
            <th width="80">备注</th>
            <th width="70">总金额</th>
            <th width="70">方案</th>
            <th width="70">确认</th>
            <th width="100">操作</th>

        </tr>
        </thead>
        <tbody>

        {volist name='c' id='vo' key='i'}
        <tr class="text-c">
            <!--<td class="col-1">{$vo.capital_id}</td>-->
            <td >{$vo.wen_a}</td>
            <td >{$vo.wen_b}</td>
            <td >{$vo.wen_c}</td>
            <td >{$vo.class_a}</td>
            <td >{$vo.class_b}</td>
            <td >{$vo.square}/{$vo.company}</td>
            <td >{$vo.un_Price}</td>
            <td >{$vo.rule}</td>

            <!--<td >{$vo.rule}</td>-->
            <td ><?php if($vo['zhi'] ==1){ ?>是<?php }else{ ?>否<?php }?></td>
            <td >{:date('Y-m-d H:i:s',$vo.crtime)}</td>
            <td > <?php if(is_array($vo['capitalgo'])) foreach($vo['capitalgo'] as $user){ ?>
                <img style="width:10%;" src="<?php echo $user ?>">
                <?php } ?></td>


            <!--<td >{$vo.give_money}</td>-->
            <td >{$vo.give_d}</td>
            <td >{$vo.give_remarks}</td>
            <td >{$vo.to_price} </td>
            <td >{$vo.programme} </td>
            <td >{$vo.enable} </td>
            <td>
                <a style="text-decoration:none" class="ml-5 edit1"  data-id="{$vo.capital_id}" key="{$i}"  count="<?php echo count($capital) ?>"  href="javascript:;" title="编辑"><span class="label label-primary">编辑</span></a><a style="text-decoration:none" class="ml-5 del1"  data-id="{$vo.capital_id}" key="{$i}"  count="<?php echo count($capital) ?>"  href="javascript:;" title="删除"><span class="label label-default">删除</span></a>
            </td>
        </tr>

        {/volist}
        </tbody>
    </table>
    <div class="pages" style="float: right">{$c->render()}</div>
</article>
{include file="public/footer"}
<script>


    /**
     * 基建
     */
    $('.edit1').click(function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/edit1')}";
        layer.open({
            type: 2,
            area: ['800px', '700px'],
            fix: false,
            maxmin: true,
            shade: 0.4,
            title: '基检编辑',
            content: src + '?type=2&order_id=' + id
        });
    });
    /**
     * 基建
     */
    $('.del1').click(function () {
        var capital_id = $(this).attr('data-id');
        var key =$(this).attr('key');
        var count =$(this).attr('count');
        var src = "{:Url('index/order/del1')}";
        var ss=0;
        if(count !=1 && key ==1) {
            ss=1;
        }
        layer.confirm('确认要删除该基检么？', function (index) {
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    capital_id: capital_id,
                    key: ss,

                },
                success: function (data) {
                    var res = JSON.parse(data);
                    if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                            parent.location.reload()
                        });
                    } else {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    });

</script>
</body>
</html>